<?php
	include '../ini.php';
	include '../../libraries/xl_phuong_thuc_thanh_toan.php';
	$dt_xl_phuong_thuc_thanh_toan=new xl_phuong_thuc_thanh_toan;

	if(empty($_GET['ma']) || !is_numeric($_GET['ma']))
	{
		$_SESSION['msg'] = "Lỗi! Mã không hộp lệ, vui lòng kiểm tra lại.";
		$_SESSION['type_msg'] = "error";
		header('Location: '.$_SERVER['HTTP_REFERER']);
		exit;
	}
	$ma=$_GET['ma'];
	$pttt=$dt_xl_phuong_thuc_thanh_toan->xem($ma);
	if($pttt=='')
	{
		$_SESSION['msg'] = "Lỗi! Mã không hộp lệ, vui lòng kiểm tra lại.";
		$_SESSION['type_msg'] = "error";
		header('Location: '.$_SERVER['HTTP_REFERER']);
		exit;
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include'../widgets/js_css.php'?>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include '../widgets/sidebar.php'?>
  <div id="main-content"> <!-- Main Content Section with everything -->
  <!--noscript-->
    
    <!-- Page Head --> 
    <!-- End .shortcut-buttons-set -->
    
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Thêm sản phẩm</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab2">
        <?php thong_bao()?>
          <form action="cap_nhat_sm.php" method="post" enctype="multipart/form-data">
            <fieldset>
              <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
              <p>
                <label>Tên phương thức thanh toán</label>
                <input type="hidden" name="ma" value="<?php echo $pttt['ma']?>"/>
                <input class="text-input medium-input datepicker" value="<?php echo $pttt['ten_phuong_thuc']?>" type="text" id="ten" name="ten" />
                <!--<samp class="ghi_chu"> (*)</samp>--> 
              </p>
              <p>
                <label>Tác giả</label>
                <input class="text-input medium-input datepicker" value="<?php echo $pttt['tac_gia']?>" type="text" id="tac_gia" name="tac_gia" />
              </p>
              <p>
                <label>Nhà xuất bản</label>
                <input class="text-input medium-input datepicker" value="<?php echo $pttt['nha_xuat_ban']?>" type="text" id="nha_xuat_ban" name="nha_xuat_ban" />
              </p>
              <p>
                <label>Đơn giá</label>
                <input class="text-input small-input" type="text" value="<?php echo $pttt['don_gia']?>" id="don_gia" name="don_gia" />
                <!--<samp class="ghi_chu"> (*)</samp>--> 
              </p>
               <script>
            $(function() {
                $( "#ngay_tao" ).datepicker({
                    showOn: "button",
                    buttonImage: "../hinh_anh/calendar.gif",
                    buttonImageOnly: true
              });
            });
          </script>
          		<p>
            <label>Ngày Đăng</label>
            <input class="text-input small-input" type="text" id="ngay_tao" name="ngay_tao" value="<?php echo $ngay_tao?>" />
            <!-- Classes for input-notification: success, error, information, attention --> 
            <br />
            <small>Nhập vào dạng ngày tháng MM/DD/YYYY</small> </p>
              <p>
                <label>Hình</label>
                <input class="text-input small-input" type="file" value="<?php echo $pttt['hinh']?>" id="hinh" name="hinh" />
              <p><img width="200px;" src="../../upload/products/<?php echo $pttt['hinh']?>"/></p>
              </p>
              <p>
                <label>Hiển thị sản phẩm mới</label>
                <input type="radio" checked="checked" value="1" name="pttt_moi">
                Hiển thị <br>
                <input type="radio" value="0" name="pttt_moi">
                Không hiển thị </p>
              <br>
              <p align="center">
                <input class="button" type="submit" value="Cặp nhật" />
                <input class="button" type="button" onclick="window.location.href='danh_sach.php'" value="Hủy"/>
              </p>
            </fieldset>
            <div class="clear"></div>
            <!-- End .clear -->
            
          </form>
        </div>
        <!-- End #tab2 --> 
        
      </div>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <div class="clear"></div>
    <div id="footer"> <small> <!-- Remove this notice or replace it with whatever you want --> 
    <!-- End #footer --> 
    
  </div>
  <!-- End #main-content --> 
</div>
</body>
</html>
